/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package structure;
import java.util.*;
import java.io.*;

/**
 *
 * @author antonio
 */
public class LoaderPointsToRoom {

    private Hashtable pointsToRoom = new Hashtable();

    private String nomeFile = "E:\\Documents and Settings\\antonio\\Documenti\\points.txt";

    public Hashtable loadPointsToRoom()
    {
        try{

            File f = new File(nomeFile);

            BufferedReader reader = new BufferedReader(new FileReader(f));

            while(true)
            {
                String line = reader.readLine();
                if(line == null)
                {
                    break;
                }
                else
                {
                    StringTokenizer tokenizer = new StringTokenizer(line, " ");

                    String point = tokenizer.nextToken();
                    String room = tokenizer.nextToken();

                    this.pointsToRoom.put(point, room);
                }
            }

        }catch(Exception e)
        {
            e.printStackTrace();
        }

        return this.pointsToRoom;
    }

}
